<template>
    <div>
        <h2>显示科室管理</h2>
        <div>
            科室名称:
            <input type="text" v-model="info.Ksname">
            <input type="button" value="查询" class="btn btn-success" @click="showListksgl">
        </div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>科室名称</td>
                    <td>科室照片</td>
                    <td>成立日期</td>
                </tr>
                <tr v-for="item in data" :key="item.id">
                    <td>{{ item.Ksname }}</td>
                    <td><img :src="item.Ksphoto" width="50" height="50" ></td>
                    <td>{{ moment(item.Cltime).format('YYYY-MM-DD') }}</td>
                </tr>
            </tbody>
        </table>
        
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted}from 'vue'
import axios from 'axios'; 
import moment from 'moment';
import{useRoute,useRouter}from 'vue-router'
const route=useRoute();
const router=useRouter();

let info:any=reactive({
    Ksname:'',
})

let data:any=ref([]);

onMounted(()=>{
    showListksgl();
})
const showListksgl=()=>{
    axios({
        url:"/api/Yklx/GetListKsgl",
        method:'get',
        params:info
    })
    .then((res)=>{
        data.value=res.data
    })
}
</script>

<style scoped>

</style>